**Schooling using recent 2st century data 
clear
clear matrix
clear mata
cap log close
************************************************************************************
**change directory here
* DIRECTORY ROADMAP
sysdir set PLUS C:\ado\plus\c
************************************************************************************

global dir1 C:\Users\hab55\Dropbox\Second_paper_Ghana\2023_EDCC_Price\Data
global dir2 C:\Users\hab55\Dropbox\Second_paper_Ghana\2023_EDCC_Price\Do
global dir3 C:\Users\hab55\Dropbox\Second_paper_Ghana\2023_EDCC_Price\Output

////////////////////////////////////////////////////////////////////////////////
use "$dir1\schooling_recent_2003_2013_data", clear
///Table D.14:

///Panel A: attendance 
areg attendance shockc i.agey gender genderhd i.ROB#c.year i.year i.YOB if agey>=6 & agey<=17 [aw=weight], ab (ROB ) cluster (ROB)
boottest shockc=0 ,  nograph  seed(321448699) 
outreg2 using "$dir3\school_21.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg attendance shockc i.agey gender genderhd i.ROB#c.year i.year i.YOB if agey>=6 & agey<=11 [aw=weight], ab (ROB ) cluster (ROB)
boottest shockc=0 ,  nograph   seed(321448699) 
outreg2 using "$dir3\school_21.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg attendance shockc i.agey gender genderhd i.ROB#c.year i.year i.YOB if agey>11 & agey<=14 [aw=weight], ab (ROB ) cluster (ROB)
boottest shockc=0 ,  nograph   seed(321448699) 
outreg2 using "$dir3\school_21.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg attendance shockc i.agey gender genderhd i.ROB#c.year i.year i.YOB if agey>14 [aw=weight] , ab (ROB ) cluster (ROB)
boottest shockc=0 ,  nograph   seed(321448699) 
outreg2 using "$dir3\school_21.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

///////////////////////////////////

///Panel B: grade-for-age 
areg ontrack shockc1 i.agey gender genderhd i.ROB#c.year i.year i.YOB if agey>=6 & agey<=17 [aw=weight], ab (ROB ) cluster (ROB)
boottest shockc1=0 ,  nograph  seed(321448699) 
outreg2 using "$dir3\ontrack_21.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg ontrack shockc1 i.agey gender genderhd i.ROB#c.year i.year i.YOB if agey>=6 & agey<=11 [aw=weight], ab (ROB ) cluster (ROB)
boottest shockc1=0 ,  nograph   seed(321448699) 
outreg2 using "$dir3\ontrack_21.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg ontrack shockc1 i.agey gender genderhd i.ROB#c.year i.year i.YOB if agey>11 & agey<=14 [aw=weight], ab (ROB ) cluster (ROB)
boottest shockc1=0 ,  nograph   seed(321448699) 
outreg2 using "$dir3\ontrack_21.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg ontrack shockc1 i.agey gender genderhd ii.ROB#c.year i.year i.YOB if agey>14 [aw=weight] , ab (ROB ) cluster (ROB)
boottest shockc1=0 ,  nograph   seed(321448699) 
outreg2 using "$dir3\ontrack_21.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

///////////////////////////////////